import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'Login',
            component:()=>import("@/pages/Login.vue")
        },
        {
            path: '/index.html',
            name: 'Index',
            component:()=>import("@/pages/Index.vue"),
            redirect: '/dashboard',
            children:[
                {
                    path: '/dashboard',
                    name: 'Dashboard',
                    component:()=>import("@/pages/dashboard/Index.vue")
                },
                {
                    path: '/user',
                    name: 'User',
                    component:()=>import("@/pages/user/Index.vue")
                },
                {
                    path: '/personal',
                    name: 'Personal',
                    component:()=>import("@/pages/user/Personal.vue")
                },
                {
                    path: '/resource',
                    name: 'Resource',
                    component:()=>import("@/pages/resource/Index.vue")
                },
                {
                    path: '/resource/edit',
                    name: 'ResourceEdit',
                    component:()=>import("@/pages/resource/Edit.vue")
                },
                {
                    path: '/category',
                    name: 'Category',
                    component:()=>import("@/pages/category/Index.vue")
                },
                {
                    path:'/cardKey',
                    name:'CardKey',
                    component:()=>import("@/pages/cardKey/Index.vue")
                }
            ]
        }
    ]
})

export default router
